<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Title</title>
    <%@include file="/WEB-INF/views/commons/commons.jsp" %>

    <script src="/static/js/system/employee.js"></script>
</head>
<body>
<table id="emp_datagrid"></table>

<!--工具栏-->
<div id="tb">
    <shiro:hasPermission name="employee:save">
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" data-cmd="add">添加</a>
    </shiro:hasPermission>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" data-cmd="edit">编辑</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" id="change_btn"
       data-cmd="changeState">离职</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" data-cmd="reload">刷新</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-redo',plain:true" data-cmd="into">导入</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-undo',plain:true" data-cmd="export">导出</a>

    <input class="easyui-textbox" type="text" name="keyword" id="keyword" prompt="按照名字或电话查询"/>
    入职时间:<input class="easyui-datebox" type="text" name="startDate" id="startDate"/>
    ~<input class="easyui-datebox" type="text" name="endDate" id="endDate"/>
    部门:<input class="easyui-combobox" type="text" name="deptId" id="deptId"
              data-options="url:'/department/queryDepts',
                        valueField:'id',textField:'name',panelHeight:'auto'"/>

    <a hreg="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="query()">查询</a>
</div>

<!--员工添加与编辑的对话框-->
<div id="emp_dialog">
    <!--员工信息的form表单-->
    <form id="emp_form" method="post" style="padding: 22px 0px 0px 50px;">
        <input type="hidden" id="empId" name="id">
        <table style="border-collapse: separate;border-spacing: 10px;">
            <tr>
                <td>名称:</td>
                <td><input class="easyui-textbox" type="text" name="username"
                           prompt="请输入用户名" invalidMessage="用户名已存在"
                           validType="remote['/employee/validateUsername?id='+empId.value,'username']"></td>
            </tr>
            <tr>
                <td>真实名:</td>
                <td><input class="easyui-textbox" type="text" name="realname"></td>
            </tr>
            <tr>
                <td>电话:</td>
                <td><input class="easyui-textbox" type="text" name="tel"></td>
            </tr>
            <tr>
                <td>邮箱:</td>
                <td><input class="easyui-textbox" type="text" name="email"></td>
            </tr>
            <tr>
                <td>入职时间:</td>
                <td><input class="easyui-datebox" type="text" name="hiredate"></td>
            </tr>
            <tr>
                <td>部门:</td>
                <td><input class="easyui-combobox" type="text" name="dept.id"
                           data-options="url:'/department/queryDepts',
                        valueField:'id',textField:'name',panelHeight:'auto'"/></td>
            </tr>
            <tr>
                <td>管理员:</td>
                <td><input class="easyui-combobox" type="text" name="admin"
                           data-options="data:[{'value':'0','text':'否'}, {'value':'1','text':'是'}],
                           valueField:'value', textField:'text',panelHeight:'auto'"/></td>
            </tr>
            <tr>
                <td>角色:</td>
                <td><input class="easyui-combobox" type="text" id="rolesId"
                           data-options="valueField:'id', textField:'name',panelHeight:'auto',
                            url:'/role/queryRoles',multiple:true"/>
                </td>
            </tr>
        </table>
    </form>
</div>

<!--员工添加有编辑的底部按钮-->
<div id="bb">
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true" data-cmd="save">保存</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true" data-cmd="cancel">取消</a>
</div>


</body>
</html>
